package com.zhangye.test.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zhangye.test.model.PayList;
import com.zhangye.test.service.PayListService;
import com.zhangye.test.service.SafeSessionService;

@Controller
@RequestMapping("api/payList")
public class PayListApi {

	@Autowired
	private PayListService payListService;// 短信
	@Autowired
	private SafeSessionService safeSessionService;// 安全登录


	/**
	 * 列表
	 * 作者： 张叶
	 * 创建时间：2018年7月12日  下午2:13:48
	 */
	@ResponseBody
	@RequestMapping(value = "/list", method = RequestMethod.GET)
	public ApiResult list() {
		ApiResult result = new ApiResult();
		List<PayList> list = payListService.selectAll();
		if(list.size() > 0){
			result.data.put("payList", list);
			result.msg.status = 0;
			result.msg.desc = "获取成功!";
		} else {
			result.msg.status = 1;
			result.msg.desc = "暂无数据";
		}
		return result;
	}

}
